package com.example.mapper;

//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pojo.entity.Activity;
import com.example.pojo.entity.Collection;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ActivityMapper {

    @Insert("insert into activity(name,picture,description,content,location,time,head,price,show_state) values(#{name},#{picture},#{description},#{content},#{location},#{time},#{head},#{price},#{showState})")
    void insert(Activity activity);


    @Update("update activity set name=#{name},picture=#{picture},description=#{description},content=#{content},location=#{location},time=#{time},head=#{head},price=#{price},show_state=#{showState} where id=#{id}")
    void updateById(Activity activity);

    @Delete("delete from activity where id=#{id}")
    void removeById(Integer id);

    @Select("select * from activity ")
    List<Activity> list();

    @Select("select * from activity where id=#{id}")
    Activity getById(Integer id);

    List<Activity> selectByPage(String name,Integer showState);

    @Select("select * from activity where name=#{name} ")
    Activity selectByName(String activity);
}
